import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/layout'

/**
 * Note: 路由配置项
 *
 * hidden: true                     // 当设置 true 的时候该路由不会再侧边栏出现 如401，login等页面，或者如一些编辑页面/edit/1
 * alwaysShow: true                 // 当你一个路由下面的 children 声明的路由大于1个时，自动会变成嵌套的模式--如组件页面
 *                                  // 只有一个时，会将那个子路由当做根路由显示在侧边栏--如引导页面
 *                                  // 若你想不管路由下面的 children 声明的个数都显示你的根路由
 *                                  // 你可以设置 alwaysShow: true，这样它就会忽略之前定义的规则，一直显示根路由
 * redirect: noRedirect             // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
 * name:'router-name'               // 设定路由的名字，一定要填写不然使用<keep-alive>时会出现各种问题
 * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数
 * roles: ['admin', 'common']       // 访问路由的角色权限
 * permissions: ['a:a:a', 'b:b:b']  // 访问路由的菜单权限
 * meta : {
 noCache: true                   // 如果设置为true，则不会被 <keep-alive> 缓存(默认 false)
 title: 'title'                  // 设置该路由在侧边栏和面包屑中展示的名字
 icon: 'svg-name'                // 设置该路由的图标，对应路径src/assets/icons/svg
 breadcrumb: false               // 如果设置为false，则不会在breadcrumb面包屑中显示
 activeMenu: '/system/user'      // 当路由设置了该属性，则会高亮相对应的侧边栏。
 }
 */

// 公共路由
export const constantRoutes = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/views/redirect')
      }
    ]
  },
  // {
  //   path: '/index',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: '/index',
  //       component: () => import('@/views/index')
  //     }
  //   ]
  // },
  {
    path: '/login',
    component: () => import('@/views/login'),
    hidden: true
  },

  {
    path: '/register',
    component: () => import('@/views/register'),
    hidden: true
  },
  {
    path: '/hp',
    component: () => import('@/views/homePage/homePage'),
    hidden: true
  },
  {
    path: '/404',
    component: () => import('@/views/error/404'),
    hidden: true
  },
  {
    path: '/401',
    component: () => import('@/views/error/401'),
    hidden: true
  },
  {
    path: '/',
    component: Layout,
    hidden: true,
    redirect: 'index',
    children: [
      {
        path: 'index',
        component: () => import('@/views/index'),
        name: 'Index',
        meta: { title: '首页', icon: 'dashboard', affix: true }
      }
    ]
  },
  {
    path: '/user',
    component: Layout,
    hidden: true,
    redirect: 'noredirect',
    children: [
      {
        path: 'profile',
        component: () => import('@/views/system/user/profile/index'),
        name: 'Profile',
        meta: { title: '个人中心', icon: 'user' }
      }
    ]
  },
  //企业端:荣誉资质
  {
    path: '/',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/system/userNew',
        component: () => import('@/views/system/user/index'),
        name: 'userNew',
        meta: { title: '用户管理', icon: '' }
      }
    ]
  },


  //平台端:用户管理
  {
    path: '/system',
    component: Layout,
    hidden: true,
    children: [
      // {
      //   path: "/userNew",
      //   component: () => import('@/views/system/role/index'),
      //   name: 'User',
      //   meta: { title: '用户管理', icon: '' }
      // },
      {
        path: '/role',
        component: () => import('@/views/system/role/index'),
        name: 'role',
        meta: { title: '角色管理', icon: '' }

      },
      {
        path: '/menu',
        component: () => import('@/views/system/menu/index'),
        name: 'menu',
        meta: { title: '菜单管理', icon: '' }
      },
      {
        path: '/dept',
        component: () => import('@/views/system/dept/index'),
        name: 'dept',
        meta: { title: '组织机构', icon: '' }
      },
      {
        path: '/post',
        component: () => import('@/views/system/post/index'),
        name: 'post',
        meta: { title: '岗位管理', icon: '' }
      },
      {
        path: '/dict',
        component: () => import('@/views/system/dict/index'),
        name: 'dict',
        meta: { title: '字典管理', icon: '' }
      },
      {
        path: '/upload',
        component: () => import('@/views/system/upload/index'),
        name: 'upload',
        meta: { title: '附件管理', icon: '' }
      },
      {
        path: '/config',
        component: () => import('@/views/system/config/index'),
        name: 'config',
        meta: { title: '参数设置', icon: '' }
      },
      {
        path: '/notice',
        component: () => import('@/views/system/notice/index'),
        name: 'notice',
        meta: { title: '通知公告', icon: '' }
      },
      {
        path: '/log/operlog',
        component: () => import('@/views/monitor/operlog/index'),
        name: 'operlog',
        meta: { title: '操作日志', icon: '' }
      },
      {
        path: '/log/logininfo',
        component: () => import('@/views/monitor/logininfor/index'),
        name: 'logininfo',
        meta: { title: '登录日志', icon: '' }
      },
      {
        path: '/information/pintaiProduct',
        component: () => import('@/views/product/examine/index'),
        name: 'logininfo',
        meta: { title: '产品审核管理', icon: '' }
      },
      {
        path: '/information/demandExamine',
        component: () => import('@/views/demand/examine/index'),
        name: 'demandExamine',
        meta: { title: '需求审核管理', icon: '' }
      },
      {
        path: '/honorManager',
        component: () => import('@/views/honor/index'),
        name: 'honorManager',
        meta: { title: '荣誉资质管理', icon: '' }
      },
      {
        path: 'procure/procure',
        component: () => import('@/views/procure/procure/index'),
        name: 'procure',
        meta: { title: '采购管理', icon: '' }
      },
      {
        path: 'procure/teacherInfo',
        component: () => import('@/views/procure/teacherInfo/index'),
        name: 'teacherInfo',
        meta: { title: '师资管理', icon: '' }
      },
      {
        path: 'qualification',
        component: () => import('@/views/qualification/index'),
        name: 'qualification',
        meta: { title: '服务产品管理', icon: '' }
      },
      {
        path: '/enterprise/sale/highSeas',
        component: () => import('@/views/enterprise/seas/index'),
        name: 'highSeas',
        meta: { title: '公海管理', icon: '' }
      },
      {
        path: '/enterprise/sale/electric',
        component: () => import('@/views/enterprise/electric/index'),
        name: 'highSeas',
        meta: { title: '电销管理', icon: '' }
      },
      {
        path: '/enterprise/person',
        component: () => import('@/views/enterprise/person/index'),
        name: 'person',
        meta: { title: '联系人管理', icon: '' }
      },
      {
        path: '/activityinfo/sendManager/activityTrain',
        component: () => import('@/views/activity/training/index'),
        name: 'activityTrain',
        meta: { title: '活动培训发送模块', icon: '' }
      },
      {
        path: '/activityinfo/sendManager/policy',
        component: () => import('@/views/policy/release/index'),
        name: 'policy',
        meta: { title: '政策发布模块', icon: '' }
      },
      {
        path: '/activityinfo/sendManager/demand',
        component: () => import('@/views/demand/release/index'),
        name: 'policy',
        meta: { title: '需求发布模块', icon: '' }
      },
      {
        path: '/activityinfo/sendManager/product',
        component: () => import('@/views/product/release/index'),
        name: 'product',
        meta: { title: '产品发布模块', icon: '' }
      },
      {
        path: '/activityinfo/sendManager/questionnaire',
        component: () => import('@/views/questionnaire/investigation/index'),
        name: 'questionnaire',
        meta: { title: '问卷调查发送模块', icon: '' }
      },
      {
        path: '/activityinfo/receiveManager/receive',
        component: () => import('@/views/activity/receive/index'),
        name: 'receive',
        meta: { title: '活动培训接收模块', icon: '' }
      },
      {
        path: '/activityinfo/receiveManager/reception',
        component: () => import('@/views/questionnaire/reception/index'),
        name: 'reception',
        meta: { title: '问卷调查接收模块', icon: '' }
      },
      {
        path: '/activityinfo/receiveManager/policyReception',
        component: () => import('@/views/policy/receive/index'),
        name: 'policyReception',
        meta: { title: '政策发布接收模块', icon: '' }
      },
      {
        path: '/activityinfo/receiveManager/demandReception',
        component: () => import('@/views/demand/receive/index'),
        name: 'demandReception',
        meta: { title: '需求发布接收模块', icon: '' }
      },
      {
        path: '/activityinfo/receiveManager/productReception',
        component: () => import('@/views/product/receive/index'),
        name: 'productReception',
        meta: { title: '产品发布接收模块', icon: '' }
      },
      {
        path: '/activityinfo/examine/examine',
        component: () => import('@/views/activity/examine/index'),
        name: 'examineActivity',
        meta: { title: '活动培训审核模块', icon: '' }
      },
      {
        path: '/activityinfo/examine/questionExamine',
        component: () => import('@/views/questionnaire/examine/index'),
        name: 'questionExamine',
        meta: { title: '问卷调查审核模块', icon: '' }
      },
      {
        path: '/activityinfo/examine/policyReception',
        component: () => import('@/views/policy/examine/index'),
        name: 'questionExamine',
        meta: { title: '政策发布审核模块', icon: '' }
      },
      {
        path: '/activityinfo/examine/ProductExamine',
        component: () => import('@/views/product/examine/index'),
        name: 'questionExamine',
        meta: { title: '产品发布审核模块', icon: '' }
      },
      {
        path: '/activityinfo/examine/demandExamine',
        component: () => import('@/views/demand/examine/index'),
        name: 'questionExamine',
        meta: { title: '需求发布审核模块', icon: '' }
      },
    ]
  },

  //企业端:荣誉资质
  {
    path: '/enterprise',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/Honor',
        component: () => import('@/views/honor/index'),
        name: 'Honor',
        meta: { title: '荣誉资质管理', icon: '' }
      }
    ]
  },
  // //服务端:荣誉资质
  // {
  //   path: '/server',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: '/honorManager',
  //       component: () => import('@/views/honor/index'),
  //       name: 'honorManager',
  //       meta: { title: '荣誉资质管理', icon: '' }
  //     }
  //   ]
  // },
  //服务端:文件柜维护
  {
    path: '/file',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'information',
        component: () => import('@/views/file/information'),
        name: 'information',
        meta: { title: '文件柜维护', icon: '' }
      }
    ]
  },
  //服务端:内部文件
  {
    path: '/file',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'internal',
        component: () => import('@/views/file/internal'),
        name: 'internal',
        meta: { title: '内部文件', icon: '' }
      }
    ]
  },
  //服务端:文件柜维护
  {
    path: '/file',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'external',
        component: () => import('@/views/file/external'),
        name: 'external',
        meta: { title: '外部文件', icon: '' }
      }
    ]
  },
  // //服务端:采购管理
  // {
  //   path: '/project',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'procure/procure',
  //       component: () => import('@/views/procure/procure/index'),
  //       name: 'procure',
  //       meta: { title: '采购管理', icon: '' }
  //     }
  //   ]
  // },
  //服务端:师资管理
  // {
  //   path: '/project',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'procure/teacherInfo',
  //       component: () => import('@/views/procure/teacherInfo/index'),
  //       name: 'teacherInfo',
  //       meta: { title: '师资管理', icon: '' }
  //     }
  //   ]
  // },
  //服务端:供应商管理
  {
    path: '/enterprise',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/supplier',
        component: () => import('@/views/supplier/index'),
        name: 'Supplier',
        meta: { title: '供应商管理', icon: '' }
      }
    ]
  },
  //服务端:平台关系管理
  {
    path: '/enterprise',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/relationship',
        component: () => import('@/views/relationship/index'),
        name: 'Relationship',
        meta: { title: '平台关系管理', icon: '' }
      }
    ]
  },
  {
    path: '/enterprise',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/statistics',
        component: () => import('@/views/statistics/index'),
        name: 'Statistics',
        meta: { title: '产品项目统计', icon: '' }
      }
    ]
  },
  {
    path: '/enterprise',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/credential',
        component: () => import('@/views/credential/index'),
        name: 'Credential',
        meta: { title: '荣誉资源商机', icon: '' }
      }
    ]
  },
  //合作管理
  {
    path: '/operate',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/collaborative',
        component: () => import('@/views/collaborative/index'),
        name: 'Collaborative',
        meta: { title: '合作管理', icon: '' }
      }
    ]
  },
  //合作管理
  {
    path: '/operate',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/collaborative/detail/:enterpriseId',
        component: () => import('@/views/collaborative/detail'),
        name: 'Collaborative',
        meta: { title: '企业基本信息', icon: '' }
      }
    ]
  },
  //服务端:资质产品管理
  // {
  //   path: '/',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'qualification',
  //       component: () => import('@/views/qualification/index'),
  //       name: 'qualification',
  //       meta: { title: '服务产品管理', icon: '' }
  //     }
  //   ]
  // },


  // {
  //   path: '/procure',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'teacherInfo',
  //       component: () => import('@/views/procure/teacherInfo/index'),
  //       name: 'teacherInfo',
  //       meta: { title: '师资管理', icon: '' }
  //     }
  //   ]
  // },
  //服务端:往来管理
  {
    path: '/project',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'procure/backandforth',
        component: () => import('@/views/project/forth/index'),
        name: 'procure/backandforth',
        meta: { title: '往来管理', icon: '' }
      }
    ]
  },
  //服务端:渠道管理
  {
    path: '/enterprise',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'enterpriseinfo3',
        component: () => import('@/views/enterprise/info/index'),
        name: 'enterpriseinfo3',
        meta: { title: '渠道管理', icon: '' },
        // props: { markAs: 3 }
      }
    ]
  },
  //服务端:商机管理
  {
    path: '/enterprise',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'sale/businessinfo',
        component: () => import('@/views/enterprise/businessinfo/index'),
        name: 'businessinfo',
        meta: { title: '商机管理', icon: '', activeMenu: '/sale/businessinfo' }
      }
    ]
  },
  //服务端:报价单审核管理
  {
    path: '/enterprise',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'sale/quotationReview',
        component: () => import('@/views/enterprise/businessinfo/review'),
        name: 'businessinfo',
        meta: { title: '报价单审核', icon: '' }
      }
    ]
  },
  //服务端:公海管理
  // {
  //   path: '/enterprise',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'sale/highSeas',
  //       component: () => import('@/views/enterprise/seas/index'),
  //       name: 'highSeas',
  //       meta: { title: '公海管理', icon: '' }
  //     }
  //   ]
  // },
  //服务端:电销管理
  // {
  //   path: '/enterprise',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'sale/electric',
  //       component: () => import('@/views/enterprise/electric/index'),
  //       name: 'highSeas',
  //       meta: { title: '电销管理', icon: '' }
  //     }
  //   ]
  // },
  //服务端:人员管理
  // {
  //   path: '/enterprise',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'person',
  //       component: () => import('@/views/enterprise/person/index'),
  //       name: 'person',
  //       meta: { title: '人员管理', icon: '' }
  //     }
  //   ]
  // },

  //服务端:客户管理
  {
    path: '/enterprise',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'enterpriseinfo',
        component: () => import('@/views/enterprise/info/index'),
        name: 'enterprise',
        meta: { title: '客户管理', icon: '' },
        // props: { markAs: 1 }
      }
    ]
  },
  //服务端:合同管理
  {
    path: '/project',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'contractManager',
        component: () => import('@/views/contract/index'),
        name: 'contractManager',
        meta: { title: '合同管理', icon: '' }
      }
    ]
  },


  //服务端:合同评审
  {
    path: '/project',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'contractReview',
        component: () => import('@/views/contract/list'),
        name: 'contractReview',
        meta: { title: '合同评审', icon: '' }
      }
    ]
  },

  //服务端:项目立项
  {
    path: '/project',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'info',
        component: () => import('@/views/project/info/index'),
        name: 'info',
        meta: { title: '项目立项', icon: '' }
      }
    ]
  },
  // //企业端文控中心
  // {
  //   path: '/qiyeInformation',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'Internal',
  //       component: () => import('@/views/file/internal'),
  //       name: 'internal',
  //       meta: { title: '内部文件', icon: '' }
  //     },
  //     {
  //       path: 'Information',
  //       component: () => import('@/views/file/information'),
  //       name: 'information',
  //       meta: { title: '文件柜维护', icon: '' }
  //     },
  //     {
  //       path: 'External',
  //       component: () => import('@/views/file/external'),
  //       name: 'external',
  //       meta: { title: '外部文件', icon: '' }
  //     }
  //   ]
  // },


  // //企业端：信息接收
  // {
  //   path: '/qiyeActivity',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'qiyeReceive',
  //       component: () => import('@/views/activity/receive/index'),
  //       name: 'receive',
  //       meta: { title: '活动培训接收模块', icon: '' }
  //     },
  //     {
  //       path: 'qiyeReception',
  //       component: () => import('@/views/questionnaire/reception/index'),
  //       name: 'reception',
  //       meta: { title: '问卷调查接收模块', icon: '' }
  //     },
  //     {
  //       path: 'qiyePolicy',
  //       component: () => import('@/views/policy/receive/index'),
  //       name: 'qiyePolicy',
  //       meta: { title: '政策发布接收模块', icon: '' }
  //     },
  //     {
  //       path: 'qiyeProduct',
  //       component: () => import('@/views/product/receive/index'),
  //       name: 'qiyeProduct',
  //       meta: { title: '产品发布接收模块', icon: '' }
  //     },
  //     {
  //       path: 'qiyeDemand',
  //       component: () => import('@/views/demand/receive/index'),
  //       name: 'qiyeDemand',
  //       meta: { title: '需求发布接收模块', icon: '' }
  //     },
  //   ]
  // },


  // //服务端:信息培训发送模块
  // {
  //   path: '/activityinfo',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: '/activityinfo/sendManager/activityTrain',
  //       component: () => import('@/views/activity/training/index'),
  //       name: 'activityTrain',
  //       meta: { title: '活动培训发送模块', icon: '' }
  //     },
  //     {
  //       path: '/activityinfo/sendManager/policy',
  //       component: () => import('@/views/policy/release/index'),
  //       name: 'policy',
  //       meta: { title: '政策发布模块', icon: '' }
  //     },
  //     {
  //       path: '/activityinfo/sendManager/demand',
  //       component: () => import('@/views/demand/release/index'),
  //       name: 'policy',
  //       meta: { title: '需求发布模块', icon: '' }
  //     },
  //     {
  //       path: '/activityinfo/sendManager/product',
  //       component: () => import('@/views/product/release/index'),
  //       name: 'product',
  //       meta: { title: '产品发布模块', icon: '' }
  //     },
  //     {
  //       path: '/activityinfo/sendManager/questionnaire',
  //       component: () => import('@/views/questionnaire/investigation/index'),
  //       name: 'questionnaire',
  //       meta: { title: '问卷调查发送模块', icon: '' }
  //     },
  //     {
  //       path: '/activityinfo/receiveManager/receive',
  //       component: () => import('@/views/activity/receive/index'),
  //       name: 'receive',
  //       meta: { title: '活动培训接收模块', icon: '' }
  //     },
  //     {
  //       path: '/activityinfo/receiveManager/reception',
  //       component: () => import('@/views/questionnaire/reception/index'),
  //       name: 'reception',
  //       meta: { title: '问卷调查接收模块', icon: '' }
  //     },
  //     {
  //       path: '/activityinfo/receiveManager/policyReception',
  //       component: () => import('@/views/policy/receive/index'),
  //       name: 'reception',
  //       meta: { title: '政策发布接收模块', icon: '' }
  //     },
  //     {
  //       path: '/activityinfo/receiveManager/demandReception',
  //       component: () => import('@/views/demand/receive/index'),
  //       name: 'reception',
  //       meta: { title: '需求发布接收模块', icon: '' }
  //     },
  //     {
  //       path: '/activityinfo/receiveManager/productReception',
  //       component: () => import('@/views/product/receive/index'),
  //       name: 'reception',
  //       meta: { title: '产品发布接收模块', icon: '' }
  //     },
  //     {
  //       path: '/activityinfo/examine/examine',
  //       component: () => import('@/views/activity/examine/index'),
  //       name: 'examineActivity',
  //       meta: { title: '活动培训审核模块', icon: '' }
  //     },
  //     {
  //       path: '/activityinfo/examine/questionExamine',
  //       component: () => import('@/views/questionnaire/examine/index'),
  //       name: 'questionExamine',
  //       meta: { title: '问卷调查审核模块', icon: '' }
  //     },
  //     {
  //       path: '/activityinfo/examine/policyReception',
  //       component: () => import('@/views/policy/examine/index'),
  //       name: 'questionExamine',
  //       meta: { title: '政策发布审核模块', icon: '' }
  //     },
  //     {
  //       path: '/activityinfo/examine/ProductExamine',
  //       component: () => import('@/views/product/examine/index'),
  //       name: 'questionExamine',
  //       meta: { title: '产品发布审核模块', icon: '' }
  //     },
  //   ]
  // },

  // //企业端：信息接收
  //   {
  //     path: '/qiyeActivity',
  //     component: Layout,
  //     hidden: true,
  //     children: [
  //       {
  //         path: 'qiyeReceive',
  //         component: () => import('@/views/activity/receive/index'),
  //         name: 'receive',
  //         meta: { title: '活动培训接收模块', icon: '' }
  //       },
  //       {
  //         path: 'qiyeReception',
  //         component: () => import('@/views/questionnaire/reception/index'),
  //         name: 'reception',
  //         meta: { title: '问卷调查接收模块', icon: '' }
  //       },
  //     ]
  //   },
  //服务端:项目评审
  {
    path: '/project',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'projectReview',
        component: () => import('@/views/project/review/index'),
        name: 'projectReview',
        meta: { title: '项目评审', icon: '' }
      }
    ]
  },

  //服务端:项目进度
  {
    path: '/project',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'projectSchedule',
        component: () => import('@/views/project/schedule/index'),
        name: 'projectSchedule',
        meta: { title: '项目进度', icon: '' }
      }
    ]
  },
  //服务端:项目交付
  {
    path: '/project',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'projectDelivery',
        component: () => import('@/views/project/delivery/index'),
        name: 'projectDelivery',
        meta: { title: '项目交付', icon: '' }
      }
    ]
  },
  //服务端:项目查询
  {
    path: '/project',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'projectQuery',
        component: () => import('@/views/project/query/index'),
        name: 'projectQuery',
        meta: { title: '项目查询', icon: '' }
      }
    ]
  },
  //服务端:售后管理
  {
    path: '/project',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'sales',
        component: () => import('@/views/project/sales/index'),
        name: 'sales',
        meta: { title: '售后管理', icon: '' }
      }
    ]
  },


  //企业端:文控中心 文件柜维护
  {
    path: '/enterpriseFile',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'Information',
        component: () => import('@/views/file/information/index'),
        name: 'Information',
        meta: { title: '文件柜维护', icon: '' }
      }
    ]
  },
  //企业端:文控中心 内部文件
  {
    path: '/enterpriseFile',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'Internal',
        component: () => import('@/views/file/internal/index'),
        name: 'Internal',
        meta: { title: '内部文件', icon: '' }
      }
    ]
  },
  //企业端:文控中心 外部文件
  {
    path: '/enterpriseFile',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'External',
        component: () => import('@/views/file/external/index'),
        name: 'External',
        meta: { title: '外部文件', icon: '' }
      }
    ]
  },
  //企业端:自建项目
  {
    path: '/receivable',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'self',
        component: () => import('@/views/project/self/index'),
        name: 'self',
        meta: { title: '自建项目', icon: '' }
      }
    ]
  },
  //企业端:项目管理 应收管理
  {
    path: '/receivable',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'receivable',
        component: () => import('@/views/project/receivable/index'),
        name: 'ys',
        meta: { title: '应收管理', icon: '' }
      }
    ]
  },
  //企业端:项目管理 成本管理
  {
    path: '/receivable',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'costcontrol',
        component: () => import('@/views/project/costcontrol/index'),
        name: 'costcontrol',
        meta: { title: '成本管理', icon: '' }
      }
    ]
  },
  {
    path: '/flowable',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'definition/model/',
        component: () => import('@/views/flowable/definition/model'),
        name: 'Model',
        meta: { title: '流程设计', icon: '' }
      }
    ]
  },
  {
    path: '/flowable',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'task/finished/detail/index',
        component: () => import('@/views/flowable/task/finished/detail/index'),
        name: 'FinishedRecord',
        meta: { title: '流程详情', icon: '' }
      }
    ]
  },
  {
    path: '/flowable',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'task/myProcess/detail/index',
        component: () => import('@/views/flowable/task/myProcess/detail/index'),
        name: 'MyProcessRecord',
        meta: { title: '流程详情', icon: '' }
      }
    ]
  },
  {
    path: '/flowable',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'task/myProcess/send/index',
        component: () => import('@/views/flowable/task/myProcess/send/index'),
        name: 'SendRecord',
        meta: { title: '流程发起', icon: '' }
      }
    ]
  },
  {
    path: '/flowable',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'task/todo/detail/index',
        component: () => import('@/views/flowable/task/todo/detail/index'),
        name: 'TodoRecord',
        meta: { title: '流程处理', icon: '' }
      }
    ]
  },
  {
    path: '/flowable',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'task/flowForm/index',
        component: () => import('@/views/flowable/task/flowForm/index'),
        name: 'FlowForm',
        meta: { title: '流程表单', icon: '' }
      }
    ]
  },
  // {
  //   path: '/flowable',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'definition/model/',
  //       component: () => import('@/views/flowable/definition/model'),
  //       name: 'Model',
  //       meta: { title: '流程设计', icon: '' }
  //     }
  //   ]
  // },
  // {
  //   path: '/flowable',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'task/finished/detail/index',
  //       component: () => import('@/views/flowable/task/finished/detail/index'),
  //       name: 'FinishedRecord',
  //       meta: { title: '流程详情', icon: '' }
  //     }
  //   ]
  // },
  // {
  //   path: '/flowable',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'task/myProcess/detail/index',
  //       component: () => import('@/views/flowable/task/myProcess/detail/index'),
  //       name: 'MyProcessRecord',
  //       meta: { title: '流程详情', icon: '' }
  //     }
  //   ]
  // },
  // {
  //   path: '/flowable',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'task/myProcess/send/index',
  //       component: () => import('@/views/flowable/task/myProcess/send/index'),
  //       name: 'SendRecord',
  //       meta: { title: '流程发起', icon: '' }
  //     }
  //   ]
  // },
  // {
  //   path: '/flowable',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: 'task/todo/detail/index',
  //       component: () => import('@/views/flowable/task/todo/detail/index'),
  //       name: 'TodoRecord',
  //       meta: { title: '流程处理', icon: '' }
  //     }
  //   ]
  // },
  {
    path: '/tool',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'build/index',
        component: () => import('@/views/tool/build/index'),
        name: 'FormBuild',
        meta: { title: '表单配置', icon: '' }
      }
    ]
  },
  //平台端:发布管理
  {
    path: '/',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'releaseManagement',
        component: () => import('@/views/release/index'),
        name: 'releaseManagement',
        meta: { title: '发布管理', icon: '' }
      }
    ]
  },
  //平台端:网站管理
  {
    path: '/',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'websiteManagement',
        component: () => import('@/views/website/index'),
        name: 'websiteManagement',
        meta: { title: '发布管理', icon: '' }
      }
    ]
  },
  //企业信息
  {
    path: '/',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'company',
        component: () => import('@/views/system/dept/enterprise'),
        name: 'company',
        meta: { title: '企业信息', icon: '' }
      }
    ]
  },
  //服务机构
  {
    path: '/',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'organiza',
        component: () => import('@/views/system/dept/organization'),
        name: 'organiza',
        meta: { title: '服务机构', icon: '' }
      }
    ]
  },
  //用户协议
  {
    path: '/userservice',
    component: () => import('@/views/elcontent/servicebook'),
    meta: { title: '首页', icon: 'dashboard', affix: true },
    hidden: true
  },

  //公共端园区平台列表
  {
    path: '/platformlist',
    component: () => import('@/views/elcontent/platformlist'),
    hidden: true
  },
  //公共端园区平台详情列表
  {
    path: '/platformdeta/:platId',
    component: () => import('@/views/elcontent/platformdeta'),
    hidden: true
  },
  //公共端服务机构列表
  {
    path: '/servicelist',
    component: () => import('@/views/elcontent/servicelist'),
    hidden: true
  },
  //公共端服务机构详情
  {
    path: '/servicedeta/:serviceId',
    component: () => import('@/views/elcontent/servicedeta'),
    hidden: true
  },

  //安全承诺书
  {
    path: '/safety',
    component: () => import('@/views/elcontent/safetybook'),
    hidden: true
  },
  //免责说明
  {
    path: '/disclaimer',
    component: () => import('@/views/elcontent/disclaimerbook'),
    hidden: true
  },
  //隐私政策
  {
    path: '/privacy',
    component: () => import('@/views/elcontent/privacybook'),
    hidden: true
  },
  // {
  //   path: '/test',
  //   component: () => import('@/views/homePage/test'),
  //   hidden: true
  // },
  {
    path: '/test3',
    component: () => import('@/views/homePage/test3'),
    hidden: true
  },
  /* {
    path: '/test2',
    component: () => import('@/views/test2'),
    hidden: true
  }, */
  {
    path: '/inst',
    component: () => import('@/views/homePage/institutional'),
    hidden: true
  },
  // {
  //   path: '/productdet',
  //   component: () => import('@/views/homePage/productdet'),
  //   hidden: true
  // },
  // {
  //   path: '/productlist',
  //   component: () => import('@/views/homePage/productlist'),
  //   hidden: true
  // },
  //服务产品列表
  {
    path: '/fwcpl',
    component: () => import('@/views/homePage/fwcp-list'),
    hidden: true
  },
  //开放合作列表
  {
    path: '/kfhzl',
    component: () => import('@/views/homePage/kfhz-list'),
    hidden: true
  },
  //开放合作详情
  {
    path: '/kfhzd',
    component: () => import('@/views/homePage/kfhz-detail'),
    hidden: true
  },
  //服务产品详情
  {
    path: '/fwcpd',
    component: () => import('@/views/homePage/fwcp-detail'),
    hidden: true
  },
  //活动培训列表
  {
    path: '/hdpxl',
    component: () => import('@/views/homePage/hdpx-list'),
    hidden: true
  },
  //活动培训详情
  {
    path: '/hdpxd',
    component: () => import('@/views/homePage/hdpx-detail'),
    hidden: true
  },
  //最新动态列表
  {
    path: '/releaseList',
    component: () => import('@/views/homePage/zxdt-list'),
    hidden: true
  },
  //最新动态详情
  {
    path: '/releaseDetail/:releaseId',
    component: () => import('@/views/homePage/zxdt-detail'),
    hidden: true
  },
  //入驻企业列表
  {
    path: '/enrollmentlist',
    component: () => import('@/views/elcontent/enrollmentlist'),
    hidden: true
  },
  //入驻企业详情
  {
    path: '/enrollmentdetail/:deptId',
    component: () => import('@/views/elcontent/enrollmentdeta'),
    hidden: true
  },
  {
    path: '/int',
    component: () => import('@/views/homePage/introduction'),
    hidden: true
  },
  {
    path: '/aboutUs',
    component: () => import('@/views/homePage/aboutUs'),
    hidden: true
  },
  {
    path: '/enterpriselist',
    component: () => import('@/views/institution/enterpriselist'),
    hidden: true
  },
  //公共页面注册
  {
    path: '/epregister',
    component: () => import('@/views/homePage/epregister'),
    hidden: true
  },
  //公共页面园区端登录
  {
    path: '/parklogin',
    component: () => import('@/views/homePage/parklogin'),
    hidden: true
  },
  //公共页面企业端登录
  {
    path: '/eplogin',
    component: () => import('@/views/homePage/eplogin'),
    hidden: true
  },
  //公共页面机构端登录
  {
    path: '/agencylogin',
    component: () => import('@/views/homePage/islogin'),
    hidden: true
  },
  {
    path: '/system/user-auth',
    component: Layout,
    hidden: true,
    //permissions: ['system:user:edit'],
    children: [
      {
        path: 'role/:userId(\\d+)',
        component: () => import('@/views/system/user/authRole'),
        name: 'AuthRole',
        meta: { title: '分配角色', activeMenu: '/system/user' }
      }
    ]
  },
  {
    path: '/system/role-auth',
    component: Layout,
    hidden: true,
    //permissions: ['system:role:edit'],
    children: [
      {
        path: 'user/:roleId(\\d+)',
        component: () => import('@/views/system/role/authUser'),
        name: 'AuthUser',
        meta: { title: '分配用户', activeMenu: '/system/role' }
      }
    ]
  },
  {
    path: '/system/dict-data',
    component: Layout,
    hidden: true,
    //permissions: ['system:dict:list'],
    children: [
      {
        path: 'index/:dictId(\\d+)',
        component: () => import('@/views/system/dict/data'),
        name: 'Data',
        meta: { title: '字典数据', activeMenu: '/system/dict' }
      }
    ]
  },

  //用来跳商机新增界面
  {
    path: '/enterpriseInfo',
    component: Layout,
    hidden: true,
    //permissions: ['system:dict:list'],
    children: [
      {
        path: 'sale/businessinfo/:enterpriseId',
        component: () => import('@/views/enterprise/info/business'),
        name: 'Data',
        meta: { title: '客户转商机', activeMenu: '/enterprise/enterpriseInfo' }
      }
    ]
  },

  {
    path: '/supplier',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'sale/businessinfo/:enterpriseId',
        component: () => import('@/views/supplier/business'),
        name: 'Data',
        meta: { title: '供应商转商机', activeMenu: 'enterprise/supplier' }
      }
    ]
  },

  {
    path: '/relationship',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'sale/businessinfo/:enterpriseId',
        component: () => import('@/views/relationship/business'),
        name: 'Data',
        meta: { title: '平台关系转商机', activeMenu: 'enterprise/relationship' }
      }
    ]
  },
  // {
  //   path: '/system/role-auth',
  //   component: Layout,
  //   hidden: true,
  //   //permissions: ['system:role:edit'],
  //   children: [
  //     {
  //       path: 'user/:roleId(\\d+)',
  //       component: () => import('@/views/system/role/authUser'),
  //       name: 'AuthUser',
  //       meta: { title: '分配用户', activeMenu: '/system/role' }
  //     }
  //   ]
  // },
  {
    path: '/monitor/job-log',
    component: Layout,
    hidden: true,
    //permissions: ['monitor:job:list'],
    children: [
      {
        path: 'index/:jobId(\\d+)',
        component: () => import('@/views/monitor/job/log'),
        name: 'JobLog',
        meta: { title: '调度日志', activeMenu: '/monitor/job' }
      }
    ]
  },
  {
    path: '/tool/gen-edit',
    component: Layout,
    hidden: true,
    //permissions: ['tool:gen:edit'],
    children: [
      {
        path: 'index/:tableId(\\d+)',
        component: () => import('@/views/tool/gen/editTable'),
        name: 'GenEdit',
        meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
      }
    ]
  },
  {
    path: '/system/upload-file',
    component: Layout,
    hidden: true,
    //permissions: ['system:file:list'],
    children: [
      {
        path: 'index/:businessCode',
        component: () => import('@/views/system/upload/file'),
        name: 'File',
        meta: { title: '附件信息', activeMenu: '/system/upload' }
      }
    ]
  },

  {
    path: '/big-screen',
    component: Layout,
    hidden: true,
    children: [
      {
        path: 'index',
        component: () => import('@/views/bigView/index'),
        name: 'BigScreen',
        meta: { title: '数据大屏', icon: '' }
      }
    ]
  },

]

// 动态路由，基于用户权限动态去加载
export const dynamicRoutes = [
  // {
  //   path: '/system/user-auth',
  //   component: Layout,
  //   hidden: true,
  //   //permissions: ['system:user:edit'],
  //   children: [
  //     {
  //       path: 'role/:userId(\\d+)',
  //       component: () => import('@/views/system/user/authRole'),
  //       name: 'AuthRole',
  //       meta: { title: '分配角色', activeMenu: '/system/user' }
  //     }
  //   ]
  // },
  // {
  //   path: '/system/role-auth',
  //   component: Layout,
  //   hidden: true,
  //   //permissions: ['system:role:edit'],
  //   children: [
  //     {
  //       path: 'user/:roleId(\\d+)',
  //       component: () => import('@/views/system/role/authUser'),
  //       name: 'AuthUser',
  //       meta: { title: '分配用户', activeMenu: '/system/role' }
  //     }
  //   ]
  // },
  // {
  //   path: '/system/dict-data',
  //   component: Layout,
  //   hidden: true,
  //   //permissions: ['system:dict:list'],
  //   children: [
  //     {
  //       path: 'index/:dictId(\\d+)',
  //       component: () => import('@/views/system/dict/data'),
  //       name: 'Data',
  //       meta: { title: '字典数据', activeMenu: '/system/dict' }
  //     }
  //   ]
  // },
  // {
  //   path: '/monitor/job-log',
  //   component: Layout,
  //   hidden: true,
  //   //permissions: ['monitor:job:list'],
  //   children: [
  //     {
  //       path: 'index/:jobId(\\d+)',
  //       component: () => import('@/views/monitor/job/log'),
  //       name: 'JobLog',
  //       meta: { title: '调度日志', activeMenu: '/monitor/job' }
  //     }
  //   ]
  // },
  // {
  //   path: '/tool/gen-edit',
  //   component: Layout,
  //   hidden: true,
  //   //permissions: ['tool:gen:edit'],
  //   children: [
  //     {
  //       path: 'index/:tableId(\\d+)',
  //       component: () => import('@/views/tool/gen/editTable'),
  //       name: 'GenEdit',
  //       meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
  //     }
  //   ]
  // },
  // {
  //   path: '/system/upload-file',
  //   component: Layout,
  //   hidden: true,
  //   //permissions: ['system:file:list'],
  //   children: [
  //     {
  //       path: 'index/:businessCode',
  //       component: () => import('@/views/system/upload/file'),
  //       name: 'File',
  //       meta: { title: '附件信息', activeMenu: '/system/upload' }
  //     }
  //   ]
  // },

]

// 防止连续点击多次路由报错
let routerPush = Router.prototype.push;
let routerReplace = Router.prototype.replace;
// push
Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(err => err)
}
// replace
Router.prototype.replace = function push(location) {
  return routerReplace.call(this, location).catch(err => err)
}

export default new Router({
  mode: 'history', // 去掉url中的#
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})
